package com.nycreativity.elecreativity.service;

import com.nycreativity.elecreativity.entity.po.ShoppingCart;
import com.baomidou.mybatisplus.extension.service.IService;
import com.nycreativity.elecreativity.entity.param.PageParam
import com.nycreativity.elecreativity.entity.param.shoppingcart.ShoppingCartAddParam
import com.nycreativity.elecreativity.entity.param.shoppingcart.ShoppingCartUpdateParam
import com.nycreativity.elecreativity.entity.vo.shoppingcart.ShoppingCartVO
import kotlin.collections.ArrayList

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author sxt && ttxxi
 * @since 2021-03-11
 */
interface ShoppingCartService : IService<ShoppingCart> {

    /**
     * 当前用户添加购物车信息
     * @param skuIds ArrayList<Long> 商品skuId
     * @return Boolean 是否添加成功
     */
    fun addShoppingCart(shoppingCartAddParams: Array<ShoppingCartAddParam>): Boolean

    /**
     * 查询当前用户对应的购物车信息
     * @return ShoppingCartVO
     */
    fun queryShoppingCart(pageParam: PageParam): ShoppingCartVO

    /**
     * 删除当前用户对应的购物车一条或多条items
     * @param skuIds Array<Long> 商品skuId集合
     * @return Boolean 是否删除成功
     */
    fun removeShoppingCartItems(skuIds: Array<Long>): Boolean

    /**
     * 修改购物车信息
     * @param id 商品项id
     * @param shoppingCartUpdateParam ShoppingCartUpdateParam 修改参数
     * @return Boolean 是否修改成功
     */
    fun updateShoppingCartItem(id: Long, shoppingCartUpdateParam: ShoppingCartUpdateParam): Boolean
}
